package com.jiazhong.集合类.Test;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;

public class Test06 {
    public static void main(String[] args) {
        Hashtable<String ,String> hashtable=new Hashtable<>();
        hashtable.put("111","aaa");
        hashtable.put("222","bbb");
        hashtable.put("333","ccc");
        hashtable.put("444","ddd");
        hashtable.put("555","eee");
        System.out.println(hashtable);

        Enumeration<String> elements = hashtable.elements();
        while(elements.hasMoreElements()){
            String val = elements.nextElement();
            System.out.println(val);
        }

        for (Map.Entry<String,String> entry: hashtable.entrySet()){
            System.out.println(entry.getKey()+"="+entry.getValue());
        }
    }
}
